﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace YJKElementFinish.ColumnSurface.DataDefinition
{
	public class ReferenceCurveInfo
	{
		public Curve TheCurve
		{
			get
			{
				return this.m_Curve;
			}
		}

		public ElementId CurveId
		{
			get
			{
				return this.m_CurveId;
			}
		}

		public List<Wall> RefWalls
		{
			get
			{
				return this.m_RefWalls;
			}
		}

		public List<FamilyInstance> RefColumns
		{
			get
			{
				return this.m_RefColumns;
			}
		}

		public ReferenceCurveInfo(ReferenceCurveInfo rhs)
		{
			this.m_Curve = rhs.m_Curve;
			this.m_CurveId = rhs.m_CurveId;
			this.m_RefWalls = rhs.m_RefWalls;
			this.m_RefColumns = rhs.m_RefColumns;
		}

		public ReferenceCurveInfo(Curve curve, ElementId curveId)
		{
			this.m_Curve = curve;
			this.m_CurveId = curveId;
		}

		public void AddRefWall(Wall wall)
		{
			if (this.m_RefWalls.FindIndex((Wall item) => item.Id.IntegerValue == wall.Id.IntegerValue) == -1)
			{
				this.m_RefWalls.Add(wall);
			}
		}

		public void AddRefColumn(FamilyInstance column)
		{
			if (this.m_RefColumns.FindIndex((FamilyInstance item) => item.Id.IntegerValue == column.Id.IntegerValue) == -1)
			{
				this.m_RefColumns.Add(column);
			}
		}

		private Curve m_Curve;

		private ElementId m_CurveId = ElementId.InvalidElementId;

		private List<Wall> m_RefWalls = new List<Wall>();

		private List<FamilyInstance> m_RefColumns = new List<FamilyInstance>();
	}
}
